package com.dayilyword.service.impl;

import com.dayilyword.controller.UserController;
import com.dayilyword.entity.User;
import com.dayilyword.mapper.UserMapper;
import com.dayilyword.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
public class UserServiceImpl implements UserService {
    private final Logger logger = LoggerFactory.getLogger(UserController.class);

    @Autowired
    UserMapper userMapper;


    @Override
    public void insertSelective(User user) {

        userMapper.insertSelective(user);
    }

    @Override
    public void putUser(User user) {

        userMapper.updateByPrimaryKeySelective(user);

    }


    @Override
    public HashMap<String, Object> getUserInfo(User user) {
        return userMapper.getUserInfoByPhone(user);

    }

    @Override
    public User loginSql(String phone, String pwd) {
        return userMapper.loginSql(phone, pwd);
    }
}
